// IStream.h

#ifndef __ISTREAM_H
#define __ISTREAM_H


MIDL_INTERFACE("23170F69-40C1-278A-0000-000300010000")
ISequentialInStream: public IUnknown
{
  STDMETHOD(Read)(void *data, UINT32 size, UINT32 *processedSize) PURE;
  /*
  Out: if size != 0, return_value = S_OK and (*processedSize == 0),
    then there are no more bytes in stream.
  if (size > 0) && there are bytes in stream,
  this function must read at least 1 byte.
  This function is allowed to read less than number of remaining bytes in stream.
  You must call Read function in loop, if you need exact amount of data
  */
};

MIDL_INTERFACE("23170F69-40C1-278A-0000-000300020000")
ISequentialOutStream: public IUnknown
{
  STDMETHOD(Write)(const void *data, UINT32 size, UINT32 *processedSize) PURE;
  /*
  if (size > 0) this function must write at least 1 byte.
  This function is allowed to write less than "size".
  You must call Write function in loop, if you need to write exact amount of data
  */
};

MIDL_INTERFACE("23170F69-40C1-278A-0000-000300030000")
IInStream: public ISequentialInStream
{
  STDMETHOD(Seek)(INT64 offset, UINT32 seekOrigin, UINT64 *newPosition) PURE;
};

MIDL_INTERFACE("23170F69-40C1-278A-0000-000300040000")
IOutStream: public ISequentialOutStream
{
  STDMETHOD(Seek)(INT64 offset, UINT32 seekOrigin, UINT64 *newPosition) PURE;
  STDMETHOD(SetSize)(UINT64 newSize) PURE;
};

MIDL_INTERFACE("23170F69-40C1-278A-0000-000300060000")
IStreamGetSize: public IUnknown
{
  STDMETHOD(GetSize)(UINT64 *size) PURE;
};

MIDL_INTERFACE("23170F69-40C1-278A-0000-000300070000")
IOutStreamFlush: public IUnknown
{
  STDMETHOD(Flush)() PURE;
};

#endif
